<?php 
error_reporting(0);
$isadmin=1;
include "../comm/config.php";
include "check.php";

$id=$_GET["id"]; 
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
	die("数据库链接出错: " . mysql_error());
}
else
{
	mysql_query("set names utf8");
	$sql="select * from ".$BIAOTOU."websetting where id=1";
	mysql_select_db($dbname);
	$rs = mysql_query($sql);
	while ($row = mysql_fetch_array($rs))
	{
		$apisize=$row["apisize"]; 
		$hcopen=$row["hcopen"]; 
		$hctime=$row["hctime"];
		$apijk=$row["apijk"];
	}

}	
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理中心</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
table,tr,td { font-size:12px;}
table a { text-decoration:none; color:#FF6600}
table a:visted { color:#FF66CC; text-decoration:none}
.red {color: #FF3300}
-->
</style>
</head>
<body topmargin="5" leftmargin="0">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr>
    <td height="282" valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td>
          <table cellspacing="0" width="100%" height="207" style="border:1px  solid #DCEAF7;">
            <tr>
              <td height="30" colspan="2" bgcolor="E9F2FB" class="bigtext"><strong>&nbsp;<img src="images/arrow.gif" width="16" height="22" align="absmiddle" /> 缓存设置</strong></td>
            </tr>
            <tr>
              <td width="100%" colspan="2" valign="top"><table width="100%" height="300" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td valign="top"><form id="form1" name="form1" method="post" action="savetemp.php">
                    <br />
                    <table width="720"  align="center" border=1 cellpadding=0 cellspacing=0
style="border-collapse: collapse" bordercolor="#dddddd">
							<tr>
                        <td width="129" height="30" align="right" class="bigtext">缓存设置说明：</td>
                        <td width="597" height="30" class="bigtext">
<span class="red" style="padding-left:5px;">缓存清空操作必须要对网站目录下 comm 具有可写权限。<br />                    
提示，如果清理失败或被空间限制，请登录FTP 将data/Apicache删除即可       </span></td>
                    </tr>
					   <tr>
                        <td width="129" height="30" align="right" class="bigtext">缓存开关：</td>
                        <td width="597" height="30" class="bigtext">&nbsp;
                          <label>
                          <select name="hcopen">
                            <option value="1" <?php if($hcopen=="1") echo "selected";?>>开启</option>
                            <option value="0" <?php if($hcopen=="0") echo "selected";?>>关闭</option>
                          </select>
                          注:1G以下的空间建议关闭此功能。开启后及时清理网站缓存。                          </label></td>
                      </tr>
					   <tr>
                        <td width="129" height="30" align="right" class="bigtext">缓存监控开关：</td>
                    <td height="30" class="bigtext">&nbsp;
					<select name="apijk">
                      <option value="1" <?php if($apijk=="1") echo "selected";?>>开启</option>
                      <option value="0" <?php if($apijk=="0") echo "selected";?>>关闭</option>
                    </select>
                      如果您打开后台管理中心比较慢，大空间建议关闭缓存监控，500M以下建议开启。                          </td>
                      </tr>
					   <tr>
                        <td width="129" height="30" align="right" class="bigtext">缓存目录监控：</td>
                    <td height="30" class="bigtext">&nbsp;
                          <input name="apisize" type="text"  value="<?php echo $apisize?>" size="10"  class="btn3"  />
                          单位"M" 默认50M，即缓存目录大小超过50M时后台中心会做警告提示。</td>
                      </tr>
					   <tr>
                        <td width="129" height="30" align="right" class="bigtext">缓存过期时间：</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input name="hctime" type="text"  value="<?php echo $hctime;?>" size="10"  class="btn3"  />
                          单位"小时" 默认3小时，即3小时后缓存具有<span class="red">一定概率</span>会被自动删除</td>
                      </tr>
                      <tr>
                        <td height="30" align="right">&nbsp;</td>
                        <td height="30" class="bigtext">&nbsp;
                          <input type="submit" name="Submit" value=" 保 存 设 置 " /> 
                          &nbsp;&nbsp;&nbsp;
                          <label>
                          <input type="button" name="Submit2" value=" 立刻清空所有缓存 " onclick="window.location='doclear.php'" />
                          </label>
                          </td>
                      </tr>
                    </table>
                    <br />
                  </form>
                  </td>
                </tr>
              </table></td>
            </tr>
          </table></td>
        </tr>
      
    </table></td>
  </tr>
</table>
</body>
</html>
<?php mysql_close($link);?>
